% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/latlon_is.valid.R
\name{latlon_is.valid}
\alias{latlon_is.valid}
\title{Check if lat lon are OK -- validate latitudes and longitudes}
\usage{
latlon_is.valid(
  lat,
  lon,
  quiet = TRUE,
  invalid_msg_table = FALSE,
  exact_but_slow_islandareas = FALSE
)
}
\arguments{
\item{lat}{vector of latitudes
(or data.frame with colnames lat and lon, in which case lon param must be missing)}

\item{lon}{vector of longitudes}

\item{quiet}{optional logical, if TRUE, show list of bad values in console}

\item{invalid_msg_table}{set TRUE if you want a data.frame with colnames "valid" and "invalid_msg"}

\item{exact_but_slow_islandareas}{see \code{\link[=latlon_is.islandareas]{latlon_is.islandareas()}}}
}
\value{
logical vector, one element per lat lon pair (location)
}
\description{
Check each latitude and longitude value to see if they are valid.
}
\details{
NA or outside expected numeric ranges

(based on approx ranges of lat lon seen among block internal points dataset)

But note Guam, American Samoa, Northern Mariana Islands, and U.S. Virgin Islands ranges are approximated!
EJScreen has not had demographic data in those locations anyway, but can map sites there.
see latlon_is.islandareas()
and note details at https://www.britannica.com/place/Trust-Territory-of-the-Pacific-Islands
on areas no longer part of the US but still with some sites in FRS,
ids "110009291462" "110013804678" "110067353429" "110067377430" "110070929074"
e.g., https://echo.epa.gov/detailed-facility-report?fid=110067353429
or https://echo.epa.gov/detailed-facility-report?fid=110013804678

lat must be between 17.5 and 71.5, and

lon must be ( between -180 and -64) OR (between 172 and 180)
}
\examples{
 \dontrun{
 # this would only work using the EJAM package datasets frs and blockpoints:
   if (!exists("frs")) dataload_from_pins("frs")
 table(latlon_is.valid(lat =  frs$lat, lon =  frs$lon))
 # blockpoints may need to be downloaded using dataload_from_pins()
 table(latlon_is.valid(lat =  blockpoints$lat, lon =  blockpoints$lon))
  }

}
\seealso{
\code{\link[=latlon_is.usa]{latlon_is.usa()}} \code{\link[=latlon_is.islandareas]{latlon_is.islandareas()}} \code{\link[=latlon_is.available]{latlon_is.available()}} \code{\link[=latlon_is.possible]{latlon_is.possible()}}
\code{\link[=latlon_df_clean]{latlon_df_clean()}} \code{\link[=latlon_infer]{latlon_infer()}} \code{\link[=latlon_is.valid]{latlon_is.valid()}} \code{\link[=latlon_as.numeric]{latlon_as.numeric()}}
}
